package com.geekaca.service.impl;

import com.geekaca.dao.BookMapper;
import com.geekaca.dao.BrandMapper;
import com.geekaca.domain.Brand;
import com.geekaca.service.BrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import java.util.List;

@Component("brandService")
@Scope("singleton")
public class BrandServiceImpl implements BrandService {
    @Autowired
    private BrandMapper brandMapper;

//    public void setBrandMapper(BrandMapper brandMapper) {
//        this.brandMapper = brandMapper;
//    }

    @Override
    public int addBrand(Brand brand) {
         return brandMapper.insertBrand(brand);
    }

    @Override
    public List<Brand>  selectBrands() {
        return brandMapper.selectBrands();
    }
}
